home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume6 / xfig2 / patch6.3 < prev    next >
Encoding:
Internet Message Format  |  1993-04-28  |  51.8 KB

  1. From: envbvs@epb2.lbl.gov (Brian V. Smith)
  2. Newsgroups: comp.sources.x
  3. Subject: v06i083: xfig 2.0, Patch6, Part03/06
  4. Message-ID: <134789@sun.Eng.Sun.COM>
  5. Date: 24 Apr 90 22:25:49 GMT
  6. Approved: argv@sun.com
  7.  
  8. Submitted-by: envbvs@epb2.lbl.gov (Brian V. Smith)
  9. Posting-number: Volume 6, Issue 83
  10. Archive-name: xfig2/patch6.3
  11. Patch-To: xfig2: Volume 6, Issues: 9-24, 34-36, 50-56
  12.  
  13. #! /bin/sh
  14. # This is a shell archive.  Remove anything before this line, then unpack
  15. # it by saving it into a file and typing "sh file".  To overwrite existing
  16. # files, type "sh file -c".  You can also feed this as standard input via
  17. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  18. # will see the following message at the end:
  19. #        "End of archive 3 (of 6)."
  20. # Contents:  bitmap.c.diff draw.c.diff movept.c.diff psfonts.c.diff
  21. #   read.c.diff ruler.c.diff text.c.diff xtra.c.diff
  22. # Wrapped by envbvs@epb2.lbl.gov on Tue Apr 24 11:56:46 1990
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'bitmap.c.diff' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'bitmap.c.diff'\"
  26. else
  27. echo shar: Extracting \"'bitmap.c.diff'\" \(6404 characters\)
  28. sed "s/^X//" >'bitmap.c.diff' <<'END_OF_FILE'
  29. X*** bitmap.c.old    Tue Apr 24 11:48:07 1990
  30. X--- bitmap.c    Wed Apr 18 09:16:07 1990
  31. X***************
  32. X*** 12,17 ****
  33. X--- 12,18 ----
  34. X  #include "object.h"
  35. X  #include "paintop.h"
  36. X  
  37. X+ extern int        CANVAS_WIDTH, CANVAS_HEIGHT;
  38. X  extern F_compound    objects;
  39. X  
  40. X  extern int        errno;
  41. X***************
  42. X*** 24,30 ****
  43. X  
  44. X  write_bitmap(file_name)
  45. X  char    *file_name;
  46. X! {
  47. X      FILE            *fp;
  48. X      struct stat         file_status;
  49. X      char             string[180];
  50. X--- 25,31 ----
  51. X  
  52. X  write_bitmap(file_name)
  53. X  char    *file_name;
  54. X!     {
  55. X      FILE            *fp;
  56. X      struct stat         file_status;
  57. X      char             string[180];
  58. X***************
  59. X*** 45,51 ****
  60. X              }
  61. X          else {
  62. X              sprintf(string, "\"%s\" File exists. Please click the LEFT button to COMFIRM overwrite. To cancel, click the MIDDLE or RIGHT button.", file_name);
  63. X!             if (wmgr_confirm(canvas_swfd, string) != -1) {
  64. X              put_msg("No write.");
  65. X              return;
  66. X              }
  67. X--- 46,52 ----
  68. X              }
  69. X          else {
  70. X              sprintf(string, "\"%s\" File exists. Please click the LEFT button to COMFIRM overwrite. To cancel, click the MIDDLE or RIGHT button.", file_name);
  71. X!             if (wmgr_confirm(canvas_win, string) != -1) {
  72. X              put_msg("No write.");
  73. X              return;
  74. X              }
  75. X***************
  76. X*** 56,80 ****
  77. X          return;
  78. X          }
  79. X          }
  80. X!     else if (errno != ENOENT) return;  /* file does exist but stat fails */
  81. X  
  82. X!     if ((fp = fopen(file_name, "w")) == NULL) {
  83. X!         blink_msg();
  84. X!         put_msg("Couldn't open file %s, %s", file_name, sys_errlist[errno]);
  85. X!         return;
  86. X!         }
  87. X!     else {
  88. X!         create_n_write_bitmap(fp);
  89. X!         }
  90. X      }
  91. X  
  92. X! create_n_write_bitmap(fp)
  93. X! FILE    *fp;
  94. X! {
  95. X!     int     box, marker, xmin, ymin, xmax, ymax;
  96. X!     PIXRECT    bitmap, pw_pixrect, pw_prretained;
  97. X!     F_text    *t;
  98. X  
  99. X      /* Assume that there is at least one object */
  100. X      compound_bound(&objects, &xmin, &ymin, &xmax, &ymax);
  101. X  
  102. X--- 57,88 ----
  103. X          return;
  104. X          }
  105. X          }
  106. X!     else if (errno != ENOENT)    /* file does exist but stat fails */
  107. X!         return; 
  108. X  
  109. X!     create_n_write_bitmap(file_name);    /* write the bitmap file */
  110. X      }
  111. X  
  112. X! static    Boolean havegcs = False;
  113. X! static    GC sav_fill_gc[NUMFILLPATS];
  114. X! static    GC sav_un_fill_gc[NUMFILLPATS];
  115. X! static    unsigned long save_fg_color;
  116. X! static    unsigned long save_bg_color;
  117. X  
  118. X+ create_n_write_bitmap(filename)
  119. X+ char *filename;
  120. X+     {
  121. X+     int    box, marker, xmin, ymin, xmax, ymax;
  122. X+     int    width, height;
  123. X+     Window    sav_canvas, oneplane_win;
  124. X+     int    sav_pointmarker_shown;
  125. X+     Pixmap    largepm,bitmap;
  126. X+     extern    F_compound objects;
  127. X+     XVisualInfo  *visual,vinfo_template,*vis;
  128. X+     long    vinfo_mask;
  129. X+     int    nitems,i;
  130. X+     GC    xgc;
  131. X+ 
  132. X      /* Assume that there is at least one object */
  133. X      compound_bound(&objects, &xmin, &ymin, &xmax, &ymax);
  134. X  
  135. X***************
  136. X*** 81,86 ****
  137. X      if (appres.DEBUG) {
  138. X          draw_rectbox(xmin, ymin, xmax, ymax, INV_PAINT);
  139. X          }
  140. X-     put_msg("Sorry, write_bitmap not implemented for X11 yet");
  141. X-     }
  142. X  
  143. X--- 89,182 ----
  144. X      if (appres.DEBUG) {
  145. X          draw_rectbox(xmin, ymin, xmax, ymax, INV_PAINT);
  146. X          }
  147. X  
  148. X+     /* provide a small margin */
  149. X+     if ((xmin -= 10) < 0)
  150. X+         xmin = 0;
  151. X+     if ((ymin -= 10) < 0)
  152. X+         ymin = 0;
  153. X+     if ((xmax += 10) > CANVAS_WIDTH)
  154. X+         xmax = CANVAS_WIDTH;
  155. X+     if ((ymax += 10) > CANVAS_HEIGHT)
  156. X+         ymax = CANVAS_HEIGHT;
  157. X+ 
  158. X+     width = xmax-xmin+1;
  159. X+     height = ymax-ymin+1;
  160. X+ 
  161. X+     /* choose foreground/background colors as 1 and 0 respectively */
  162. X+     /* that way we can just copy the lowest plane to make the bitmap */
  163. X+ 
  164. X+     XSetPlaneMask(tool_d, gccache[PAINT], (unsigned long) 1);
  165. X+     XSetForeground(tool_d, gccache[PAINT], (unsigned long) 1);
  166. X+     XSetBackground(tool_d, gccache[PAINT], (unsigned long) 0);
  167. X+     XSetPlaneMask(tool_d, gccache[ERASE], (unsigned long) 1);
  168. X+     XSetForeground(tool_d, gccache[ERASE], (unsigned long) 0);
  169. X+     XSetBackground(tool_d, gccache[ERASE], (unsigned long) 0);
  170. X+     save_fg_color = x_fg_color.pixel;    /* save current colors */
  171. X+     save_bg_color = x_bg_color.pixel;
  172. X+     x_fg_color.pixel = 1;            /* set fore=1, back=0 */
  173. X+     x_bg_color.pixel = 0;
  174. X+     if (!havegcs)
  175. X+         {
  176. X+         havegcs = True;
  177. X+         for (i=0; i<NUMFILLPATS; i++)    /* save current fill gc's */
  178. X+         {
  179. X+         sav_fill_gc[i] = fill_gc[i];
  180. X+         sav_un_fill_gc[i] = un_fill_gc[i];
  181. X+         }
  182. X+         init_fill_gc();        /* make some with 0/1 for colors */
  183. X+         }
  184. X+     else
  185. X+         for (i=0; i<NUMFILLPATS; i++)
  186. X+         {
  187. X+         xgc = sav_fill_gc[i];        /* swap our gc's with orig */
  188. X+         sav_fill_gc[i] = fill_gc[i];
  189. X+         fill_gc[i] = xgc;
  190. X+         xgc = sav_un_fill_gc[i];
  191. X+         sav_un_fill_gc[i] = un_fill_gc[i];
  192. X+         un_fill_gc[i] = xgc;
  193. X+         }
  194. X+     
  195. X+     /* create pixmap from (0,0) to (xmax,ymax) */
  196. X+     largepm = XCreatePixmap(tool_d, canvas_win, xmax+1, ymax+1, 
  197. X+                 DefaultDepthOfScreen(tool_s));
  198. X+     /* clear it */
  199. X+     XFillRectangle(tool_d, largepm, gccache[ERASE], xmin,ymin,width,height);
  200. X+     sav_canvas = canvas_win;    /* save current canvas window id */
  201. X+     canvas_win = largepm;        /* make the canvas our pixmap */
  202. X+     sav_pointmarker_shown = pointmarker_shown;  /* save the point marker */
  203. X+     pointmarker_shown = False;
  204. X+     redisplay_objects(&objects);    /* draw the figure into the pixmap */
  205. X+     XFlush(tool_d);
  206. X+     canvas_win = sav_canvas;    /* go back to the real canvas */
  207. X+     pointmarker_shown = sav_pointmarker_shown; /* restore point marker */
  208. X+     bitmap = XCreatePixmap(tool_d, canvas_win, width, height, 
  209. X+             DefaultDepthOfScreen(tool_s));
  210. X+     /* now copy one plane of the pixmap to a bitmap of the correct size */
  211. X+     XCopyPlane(tool_d, largepm, bitmap, gccache[PAINT], 
  212. X+             xmin, ymin, width, height, 0, 0, 1);
  213. X+     x_fg_color.pixel = save_fg_color;    /* put colors back to normal */
  214. X+     x_bg_color.pixel = save_bg_color;
  215. X+     XSetPlaneMask(tool_d, gccache[PAINT], (unsigned long) AllPlanes);
  216. X+     XSetForeground(tool_d, gccache[PAINT], x_fg_color.pixel);
  217. X+     XSetBackground(tool_d, gccache[PAINT], x_bg_color.pixel);
  218. X+     XSetPlaneMask(tool_d, gccache[ERASE], (unsigned long) AllPlanes);
  219. X+     XSetForeground(tool_d, gccache[ERASE], x_bg_color.pixel);
  220. X+     XSetBackground(tool_d, gccache[ERASE], x_bg_color.pixel);
  221. X+     for (i=0; i<NUMFILLPATS; i++)        /* swap back the fill gc's */
  222. X+         {
  223. X+         xgc = sav_fill_gc[i];
  224. X+         sav_fill_gc[i] = fill_gc[i];
  225. X+         fill_gc[i] = xgc;
  226. X+         xgc = sav_un_fill_gc[i];
  227. X+         sav_un_fill_gc[i] = un_fill_gc[i];
  228. X+         un_fill_gc[i] = xgc;
  229. X+         }
  230. X+     if (XWriteBitmapFile(tool_d, filename, bitmap, width, height, -1, -1)
  231. X+         != BitmapSuccess)
  232. X+         put_msg("Couldn't write bitmap file");
  233. X+     else
  234. X+         put_msg("Bitmap written to %s",filename);
  235. X+     XFreePixmap(tool_d, largepm);
  236. X+     XFreePixmap(tool_d, bitmap);
  237. X+     }
  238. END_OF_FILE
  239. if test 6404 -ne `wc -c <'bitmap.c.diff'`; then
  240.     echo shar: \"'bitmap.c.diff'\" unpacked with wrong size!
  241. fi
  242. # end of 'bitmap.c.diff'
  243. fi
  244. if test -f 'draw.c.diff' -a "${1}" != "-c" ; then 
  245.   echo shar: Will not clobber existing file \"'draw.c.diff'\"
  246. else
  247. echo shar: Extracting \"'draw.c.diff'\" \(4937 characters\)
  248. sed "s/^X//" >'draw.c.diff' <<'END_OF_FILE'
  249. X*** draw.c.old    Tue Apr 24 11:48:13 1990
  250. X--- draw.c    Mon Apr 16 11:24:55 1990
  251. X***************
  252. X*** 13,20 ****
  253. X  
  254. X  extern int        pointmarker_shown, compoundbox_shown;
  255. X  extern int        background_color, foreground_color;
  256. X- extern int        radius;
  257. X- extern PIXRECTREC    dot;
  258. X  
  259. X  /* COMMENTED OUT
  260. X  erase_objects(objects)
  261. X--- 13,18 ----
  262. X***************
  263. X*** 197,205 ****
  264. X      y = yb + wid / 2;
  265. X      xd = x*cosa + y*sina + .5;
  266. X      yd = -x*sina + y*cosa + .5;
  267. X!     pw_vector(canvas_pixwin, xc, yc, x2, y2, op, 
  268. X             (int) arrow->thickness, arrow->style, 0.0);
  269. X!     pw_vector(canvas_pixwin, xd, yd, x2, y2, op, 
  270. X             (int) arrow->thickness, arrow->style, 0.0);
  271. X      }
  272. X  
  273. X--- 195,203 ----
  274. X      y = yb + wid / 2;
  275. X      xd = x*cosa + y*sina + .5;
  276. X      yd = -x*sina + y*cosa + .5;
  277. X!     pw_vector(canvas_win, xc, yc, x2, y2, op, 
  278. X             (int) arrow->thickness, arrow->style, 0.0);
  279. X!     pw_vector(canvas_win, xd, yd, x2, y2, op, 
  280. X             (int) arrow->thickness, arrow->style, 0.0);
  281. X      }
  282. X  
  283. X***************
  284. X*** 286,292 ****
  285. X      x = point->x;
  286. X      y = point->y;
  287. X      if (line->points->next == NULL) { /* A single point */
  288. X!         XDrawPoint(tool_d, canvas_pixwin, gccache[op], x, y);
  289. X          return;
  290. X          }
  291. X      if (line->back_arrow) /* backward arrow  */
  292. X--- 284,290 ----
  293. X      x = point->x;
  294. X      y = point->y;
  295. X      if (line->points->next == NULL) { /* A single point */
  296. X!         XDrawPoint(tool_d, canvas_win, gccache[op], x, y);
  297. X          return;
  298. X          }
  299. X      if (line->back_arrow) /* backward arrow  */
  300. X***************
  301. X*** 316,322 ****
  302. X          else    /* draw dashed or dotted line segment by segment
  303. X                 otherwise when moving one segment later there
  304. X                 is an alignment problem with the dashes */
  305. X!         pw_vector(canvas_pixwin, x, y, point->x, point->y, op,
  306. X              line->thickness, line->style, line->style_val);
  307. X          xx = x; yy = y;
  308. X          x = point->x;
  309. X--- 314,320 ----
  310. X          else    /* draw dashed or dotted line segment by segment
  311. X                 otherwise when moving one segment later there
  312. X                 is an alignment problem with the dashes */
  313. X!         pw_vector(canvas_win, x, y, point->x, point->y, op,
  314. X              line->thickness, line->style, line->style_val);
  315. X          xx = x; yy = y;
  316. X          x = point->x;
  317. X***************
  318. X*** 324,330 ****
  319. X          }
  320. X      if (line->style == SOLID_LINE)
  321. X          {
  322. X!         pw_lines(canvas_pixwin, points, npoints, op, 
  323. X          line->thickness, line->style, line->style_val, 0);
  324. X          free(points);
  325. X          }
  326. X--- 322,328 ----
  327. X          }
  328. X      if (line->style == SOLID_LINE)
  329. X          {
  330. X!         pw_lines(canvas_win, points, npoints, op, 
  331. X          line->thickness, line->style, line->style_val, 0);
  332. X          free(points);
  333. X          }
  334. X***************
  335. X*** 338,347 ****
  336. X      {
  337. X      F_point        *point;
  338. X      int        xmin,xmax,ymin,ymax;
  339. X!     int        pop, thick, style;
  340. X      float        val;
  341. X      int        radius,diam;
  342. X-     XGCValues    gcv;
  343. X      GC        gc;
  344. X  
  345. X      thick = line->thickness;
  346. X--- 336,344 ----
  347. X      {
  348. X      F_point        *point;
  349. X      int        xmin,xmax,ymin,ymax;
  350. X!     int        thick, style;
  351. X      float        val;
  352. X      int        radius,diam;
  353. X      GC        gc;
  354. X  
  355. X      thick = line->thickness;
  356. X***************
  357. X*** 350,357 ****
  358. X      point = line->points;
  359. X      style = line->style;
  360. X      val   = line->style_val;
  361. X!     radius = line->pen;        /* hopefully temporary */
  362. X!     pop = (op == ERASE)? background_color: foreground_color;
  363. X  
  364. X      xmin = xmax = point->x;
  365. X      ymin = ymax = point->y;
  366. X--- 347,353 ----
  367. X      point = line->points;
  368. X      style = line->style;
  369. X      val   = line->style_val;
  370. X!     radius = line->radius;
  371. X  
  372. X      xmin = xmax = point->x;
  373. X      ymin = ymax = point->y;
  374. X***************
  375. X*** 370,385 ****
  376. X      set_line_stuff(thick,style,val,op);
  377. X      gc = gccache[op];
  378. X      diam = 2*radius;
  379. X!     XDrawArc(tool_d, canvas_pixwin, gc, xmin, ymin,
  380. X              diam, diam, 90*64, 90*64);
  381. X!     XDrawLine(tool_d, canvas_pixwin, gc, xmin, ymin+radius, xmin, ymax-radius+1);
  382. X!     XDrawArc(tool_d, canvas_pixwin, gc, xmin, ymax-diam,
  383. X              diam, diam, 180*64, 90*64);
  384. X!     XDrawLine(tool_d, canvas_pixwin, gc, xmin+radius, ymax, xmax-radius+1, ymax);
  385. X!     XDrawArc(tool_d, canvas_pixwin, gc, xmax-diam, ymax-diam,
  386. X              diam, diam, 270*64, 90*64);
  387. X!     XDrawLine(tool_d, canvas_pixwin, gc, xmax, ymax-radius, xmax, ymin+radius-1);
  388. X!     XDrawArc(tool_d, canvas_pixwin, gc, xmax-diam, ymin,
  389. X              diam, diam, 0*64, 90*64);
  390. X!     XDrawLine(tool_d, canvas_pixwin, gc, xmax-radius, ymin, xmin+radius-1, ymin);
  391. X      }
  392. X--- 366,381 ----
  393. X      set_line_stuff(thick,style,val,op);
  394. X      gc = gccache[op];
  395. X      diam = 2*radius;
  396. X!     XDrawArc(tool_d, canvas_win, gc, xmin, ymin,
  397. X              diam, diam, 90*64, 90*64);
  398. X!     XDrawLine(tool_d, canvas_win, gc, xmin, ymin+radius, xmin, ymax-radius+1);
  399. X!     XDrawArc(tool_d, canvas_win, gc, xmin, ymax-diam,
  400. X              diam, diam, 180*64, 90*64);
  401. X!     XDrawLine(tool_d, canvas_win, gc, xmin+radius, ymax, xmax-radius+1, ymax);
  402. X!     XDrawArc(tool_d, canvas_win, gc, xmax-diam, ymax-diam,
  403. X              diam, diam, 270*64, 90*64);
  404. X!     XDrawLine(tool_d, canvas_win, gc, xmax, ymax-radius, xmax, ymin+radius-1);
  405. X!     XDrawArc(tool_d, canvas_win, gc, xmax-diam, ymin,
  406. X              diam, diam, 0*64, 90*64);
  407. X!     XDrawLine(tool_d, canvas_win, gc, xmax-radius, ymin, xmin+radius-1, ymin);
  408. X      }
  409. END_OF_FILE
  410. if test 4937 -ne `wc -c <'draw.c.diff'`; then
  411.     echo shar: \"'draw.c.diff'\" unpacked with wrong size!
  412. fi
  413. # end of 'draw.c.diff'
  414. fi
  415. if test -f 'movept.c.diff' -a "${1}" != "-c" ; then 
  416.   echo shar: Will not clobber existing file \"'movept.c.diff'\"
  417. else
  418. echo shar: Extracting \"'movept.c.diff'\" \(4775 characters\)
  419. sed "s/^X//" >'movept.c.diff' <<'END_OF_FILE'
  420. X*** movept.c.old    Tue Apr 24 11:48:21 1990
  421. X--- movept.c    Mon Apr 16 11:22:13 1990
  422. X***************
  423. X*** 171,177 ****
  424. X          }
  425. X      cur_e = ellipse;
  426. X      set_temp_cursor(&crosshair_cursor);
  427. X!     win_setmouseposition(canvas_swfd, cur_x, cur_y);
  428. X      canvas_middlebut_proc = fix_movedellipsepoint;
  429. X      canvas_leftbut_proc = null_proc;
  430. X      }
  431. X--- 171,177 ----
  432. X          }
  433. X      cur_e = ellipse;
  434. X      set_temp_cursor(&crosshair_cursor);
  435. X!     win_setmouseposition(canvas_win, cur_x, cur_y);
  436. X      canvas_middlebut_proc = fix_movedellipsepoint;
  437. X      canvas_leftbut_proc = null_proc;
  438. X      }
  439. X***************
  440. X*** 279,285 ****
  441. X      last_position.x = cur_x = arc->point[movedpoint_num].x;
  442. X      last_position.y = cur_y = arc->point[movedpoint_num].y;
  443. X      set_temp_cursor(&crosshair_cursor);
  444. X!     win_setmouseposition(canvas_swfd, cur_x, cur_y);
  445. X      draw_arclink(INV_PAINT);
  446. X      canvas_locmove_proc = move_arcpoint;
  447. X      canvas_middlebut_proc = fix_movedarcpoint;
  448. X--- 279,285 ----
  449. X      last_position.x = cur_x = arc->point[movedpoint_num].x;
  450. X      last_position.y = cur_y = arc->point[movedpoint_num].y;
  451. X      set_temp_cursor(&crosshair_cursor);
  452. X!     win_setmouseposition(canvas_win, cur_x, cur_y);
  453. X      draw_arclink(INV_PAINT);
  454. X      canvas_locmove_proc = move_arcpoint;
  455. X      canvas_middlebut_proc = fix_movedarcpoint;
  456. X***************
  457. X*** 299,315 ****
  458. X  {
  459. X      switch (movedpoint_num) {
  460. X          case 0 :
  461. X!         pw_vector(canvas_pixwin, cur_x, cur_y, 
  462. X              arc->point[1].x, arc->point[1].y, op, 1, SOLID_LINE, 0.0);
  463. X          break;
  464. X          case 1 :
  465. X!         pw_vector(canvas_pixwin, arc->point[0].x, arc->point[0].y,
  466. X              cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  467. X!         pw_vector(canvas_pixwin, arc->point[2].x, arc->point[2].y,
  468. X              cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  469. X          break;
  470. X          default :
  471. X!         pw_vector(canvas_pixwin, arc->point[2].x, arc->point[2].y,
  472. X              cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  473. X          }
  474. X      }
  475. X--- 299,315 ----
  476. X  {
  477. X      switch (movedpoint_num) {
  478. X          case 0 :
  479. X!         pw_vector(canvas_win, cur_x, cur_y, 
  480. X              arc->point[1].x, arc->point[1].y, op, 1, SOLID_LINE, 0.0);
  481. X          break;
  482. X          case 1 :
  483. X!         pw_vector(canvas_win, arc->point[0].x, arc->point[0].y,
  484. X              cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  485. X!         pw_vector(canvas_win, arc->point[2].x, arc->point[2].y,
  486. X              cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  487. X          break;
  488. X          default :
  489. X!         pw_vector(canvas_win, arc->point[2].x, arc->point[2].y,
  490. X              cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  491. X          }
  492. X      }
  493. X***************
  494. X*** 368,374 ****
  495. X      last_position.x = cur_x = moved_point->x;
  496. X      last_position.y = cur_y = moved_point->y;
  497. X      set_temp_cursor(&crosshair_cursor);
  498. X!     win_setmouseposition(canvas_swfd, cur_x, cur_y);
  499. X      if (closed_spline(s) && left_point == NULL) {
  500. X          for (left_point = moved_point->next, 
  501. X          p = left_point->next; 
  502. X--- 368,374 ----
  503. X      last_position.x = cur_x = moved_point->x;
  504. X      last_position.y = cur_y = moved_point->y;
  505. X      set_temp_cursor(&crosshair_cursor);
  506. X!     win_setmouseposition(canvas_win, cur_x, cur_y);
  507. X      if (closed_spline(s) && left_point == NULL) {
  508. X          for (left_point = moved_point->next, 
  509. X          p = left_point->next; 
  510. X***************
  511. X*** 449,455 ****
  512. X      last_position.x = cur_x = moved_point->x;
  513. X      last_position.y = cur_y = moved_point->y;
  514. X      set_temp_cursor(&crosshair_cursor);
  515. X!     win_setmouseposition(canvas_swfd, cur_x, cur_y);
  516. X      switch (line->type) {
  517. X          case T_POLYGON :
  518. X          if (left_point == NULL)
  519. X--- 449,455 ----
  520. X      last_position.x = cur_x = moved_point->x;
  521. X      last_position.y = cur_y = moved_point->y;
  522. X      set_temp_cursor(&crosshair_cursor);
  523. X!     win_setmouseposition(canvas_win, cur_x, cur_y);
  524. X      switch (line->type) {
  525. X          case T_POLYGON :
  526. X          if (left_point == NULL)
  527. X***************
  528. X*** 610,616 ****
  529. X          latexarrow_mode, (magnet_mode)? 5: 1);
  530. X      if (cur_latexcursor != &crosshair_cursor)
  531. X          set_temp_cursor(&crosshair_cursor);
  532. X!     win_setmouseposition(canvas_swfd, x, y);
  533. X      new_position.x = x;
  534. X      new_position.y = y;
  535. X      clean_up();
  536. X--- 610,616 ----
  537. X          latexarrow_mode, (magnet_mode)? 5: 1);
  538. X      if (cur_latexcursor != &crosshair_cursor)
  539. X          set_temp_cursor(&crosshair_cursor);
  540. X!     win_setmouseposition(canvas_win, x, y);
  541. X      new_position.x = x;
  542. X      new_position.y = y;
  543. X      clean_up();
  544. X***************
  545. X*** 652,662 ****
  546. X      F_point    *p;
  547. X  
  548. X      if (left_point != NULL) {
  549. X!         pw_vector(canvas_pixwin, left_point->x, left_point->y,
  550. X              cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  551. X          }
  552. X      if ((p = moved_point->next) != NULL) {
  553. X!         pw_vector(canvas_pixwin, p->x, p->y, cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  554. X          }
  555. X      }
  556. X  
  557. X--- 652,662 ----
  558. X      F_point    *p;
  559. X  
  560. X      if (left_point != NULL) {
  561. X!         pw_vector(canvas_win, left_point->x, left_point->y,
  562. X              cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  563. X          }
  564. X      if ((p = moved_point->next) != NULL) {
  565. X!         pw_vector(canvas_win, p->x, p->y, cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  566. X          }
  567. X      }
  568. X  
  569. END_OF_FILE
  570. if test 4775 -ne `wc -c <'movept.c.diff'`; then
  571.     echo shar: \"'movept.c.diff'\" unpacked with wrong size!
  572. fi
  573. # end of 'movept.c.diff'
  574. fi
  575. if test -f 'psfonts.c.diff' -a "${1}" != "-c" ; then 
  576.   echo shar: Will not clobber existing file \"'psfonts.c.diff'\"
  577. else
  578. echo shar: Extracting \"'psfonts.c.diff'\" \(4525 characters\)
  579. sed "s/^X//" >'psfonts.c.diff' <<'END_OF_FILE'
  580. X*** psfonts.c.old    Tue Apr 24 11:48:34 1990
  581. X--- psfonts.c    Wed Apr 11 09:20:20 1990
  582. X***************
  583. X*** 7,48 ****
  584. X  
  585. X  #ifndef TFX
  586. X  struct _fstruct fontnames[NUMFONTS] = {
  587. X!      {"Times-Roman",        "-adobe-times-medium-r-*--*", NULL},
  588. X!      {"Times-Italic",        "-adobe-times-medium-i-*--*", NULL},
  589. X!      {"Times-Bold",            "-adobe-times-bold-r-*--*", NULL},
  590. X!      {"Times-BoldItalic",        "-adobe-times-bold-i-*--*", NULL},
  591. X!      {"AvantGarde-Book",        "NONE", NULL},
  592. X!      {"AvantGarde-BookOblique",    "NONE", NULL},
  593. X!      {"AvantGarde-Demi",        "NONE", NULL},
  594. X!      {"AvantGarde-DemiOblique",    "NONE", NULL},
  595. X!      {"Bookman-Light",        "NONE", NULL},
  596. X!      {"Bookman-LightItalic",    "NONE", NULL},
  597. X!      {"Bookman-Demi",        "NONE", NULL},
  598. X!      {"Bookman-DemiItalic",        "NONE", NULL},
  599. X!      {"Courier",            "-adobe-courier-medium-r-*--*", NULL},
  600. X!      {"Courier-Oblique",        "-adobe-courier-medium-o-*--*", NULL},
  601. X!      {"Courier-Bold",        "-adobe-courier-bold-r-*--*", NULL},
  602. X!      {"Courier-BoldOblique",    "-adobe-courier-bold-o-*--*", NULL},
  603. X!      {"Helvetica",            "-adobe-helvetica-medium-r-*--*", NULL},
  604. X!      {"Helvetica-Oblique",        "-adobe-helvetica-medium-o-*--*", NULL},
  605. X!      {"Helvetica-Bold",        "-adobe-helvetica-bold-r-*--*", NULL},
  606. X!      {"Helvetica-BoldOblique",    "-adobe-helvetica-bold-o-*--*", NULL},
  607. X!      {"Helvetica-Narrow",        "NONE", NULL},
  608. X!      {"Helvetica-Narrow-Oblique",    "NONE", NULL},
  609. X!      {"Helvetica-Narrow-Bold",    "NONE", NULL},
  610. X!      {"Helvetica-Narrow-BoldOblique",    "NONE", NULL},
  611. X!      {"NewCenturySchlbk-Roman",    "-adobe-new century schoolbook-medium-r-*--*", NULL},
  612. X!      {"NewCenturySchlbk-Italic",    "-adobe-new century schoolbook-medium-i-*--*", NULL},
  613. X!      {"NewCenturySchlbk-Bold",    "-adobe-new century schoolbook-bold-r-*--*", NULL},
  614. X!      {"NewCenturySchlbk-BoldItalic",    "-adobe-new century schoolbook-bold-i-*--*", NULL},
  615. X!      {"Palatino-Roman",        "NONE", NULL},
  616. X!      {"Palatino-Italic",        "NONE", NULL},
  617. X!      {"Palatino-Bold",        "NONE", NULL},
  618. X!      {"Palatino-BoldItalic",    "NONE", NULL},
  619. X!      {"Symbol",            "*-symbol-medium-r-*--*", NULL},
  620. X!      {"ZapfChancery-MediumItalic",    "-*-zapfchancery-medium-i-*--*", NULL},
  621. X!      {"ZapfDingbats",        "-*-zapfdingbats-*-*-*--*", NULL},
  622. X!      };
  623. X  #else
  624. X  struct _fstruct fontnames[NUMFONTS] = {
  625. X      {"Default",        "-adobe-times-medium-r-*--*", NULL},
  626. X--- 7,48 ----
  627. X  
  628. X  #ifndef TFX
  629. X  struct _fstruct fontnames[NUMFONTS] = {
  630. X!     {"Times-Roman",            "-adobe-times-medium-r-*--*", NULL},
  631. X!     {"Times-Italic",        "-adobe-times-medium-i-*--*", NULL},
  632. X!     {"Times-Bold",            "-adobe-times-bold-r-*--*", NULL},
  633. X!     {"Times-BoldItalic",        "-adobe-times-bold-i-*--*", NULL},
  634. X!     {"AvantGarde-Book",        "-schumacher-clean-medium-r-*--*", NULL} ,
  635. X!     {"AvantGarde-BookOblique",    "-schumacher-clean-medium-i-*--*", NULL} ,
  636. X!     {"AvantGarde-Demi",        "-schumacher-clean-bold-r-*--*", NULL},
  637. X!     {"AvantGarde-DemiOblique",    "-schumacher-clean-bold-i-*--*", NULL},
  638. X!     {"Bookman-Light",        "NONE", NULL},
  639. X!     {"Bookman-LightItalic",        "NONE", NULL},
  640. X!     {"Bookman-Demi",        "NONE", NULL},
  641. X!     {"Bookman-DemiItalic",        "NONE", NULL},
  642. X!     {"Courier",            "-adobe-courier-medium-r-*--*", NULL},
  643. X!     {"Courier-Oblique",        "-adobe-courier-medium-o-*--*", NULL},
  644. X!     {"Courier-Bold",        "-adobe-courier-bold-r-*--*", NULL},
  645. X!     {"Courier-BoldOblique",        "-adobe-courier-bold-o-*--*", NULL},
  646. X!     {"Helvetica",            "-adobe-helvetica-medium-r-*--*", NULL},
  647. X!     {"Helvetica-Oblique",        "-adobe-helvetica-medium-o-*--*", NULL},
  648. X!     {"Helvetica-Bold",        "-adobe-helvetica-bold-r-*--*", NULL},
  649. X!     {"Helvetica-BoldOblique",    "-adobe-helvetica-bold-o-*--*", NULL},
  650. X!     {"Helvetica-Narrow",        "NONE", NULL},
  651. X!     {"Helvetica-Narrow-Oblique",    "NONE", NULL},
  652. X!     {"Helvetica-Narrow-Bold",    "NONE", NULL},
  653. X!     {"Helvetica-Narrow-BoldOblique","NONE", NULL},
  654. X!     {"NewCenturySchlbk-Roman",    "-adobe-new century schoolbook-medium-r-*--*", NULL},
  655. X!     {"NewCenturySchlbk-Italic",    "-adobe-new century schoolbook-medium-i-*--*", NULL},
  656. X!     {"NewCenturySchlbk-Bold",    "-adobe-new century schoolbook-bold-r-*--*", NULL},
  657. X!     {"NewCenturySchlbk-BoldItalic",    "-adobe-new century schoolbook-bold-i-*--*", NULL},
  658. X!     {"Palatino-Roman",        "-*-lucidabright-medium-r-*--*", NULL},
  659. X!     {"Palatino-Italic",        "-*-lucidabright-medium-i-*--*", NULL},
  660. X!     {"Palatino-Bold",        "-*-lucidabright-demibold-r-*--*", NULL} ,
  661. X!     {"Palatino-BoldItalic",        "-*-lucidabright-demibold-i-*--*", NULL} ,
  662. X!     {"Symbol",            "*-symbol-medium-r-*--*", NULL},
  663. X!     {"ZapfChancery-MediumItalic",    "-*-zapfchancery-medium-i-*--*", NULL},
  664. X!     {"ZapfDingbats",        "-*-zapfdingbats-*-*-*--*", NULL},
  665. X!     };
  666. X  #else
  667. X  struct _fstruct fontnames[NUMFONTS] = {
  668. X      {"Default",        "-adobe-times-medium-r-*--*", NULL},
  669. END_OF_FILE
  670. if test 4525 -ne `wc -c <'psfonts.c.diff'`; then
  671.     echo shar: \"'psfonts.c.diff'\" unpacked with wrong size!
  672. fi
  673. # end of 'psfonts.c.diff'
  674. fi
  675. if test -f 'read.c.diff' -a "${1}" != "-c" ; then 
  676.   echo shar: Will not clobber existing file \"'read.c.diff'\"
  677. else
  678. echo shar: Extracting \"'read.c.diff'\" \(6773 characters\)
  679. sed "s/^X//" >'read.c.diff' <<'END_OF_FILE'
  680. X*** read.c.old    Tue Apr 24 11:48:35 1990
  681. X--- read.c    Wed Apr 18 15:36:48 1990
  682. X***************
  683. X*** 25,33 ****
  684. X  
  685. X  #define            BUF_SIZE        1024
  686. X  
  687. X! char            buf[BUF_SIZE];
  688. X! int            line_no;
  689. X! int            num_object;
  690. X  
  691. X  read_fail_message(file, err)
  692. X  char    *file;
  693. X--- 25,34 ----
  694. X  
  695. X  #define            BUF_SIZE        1024
  696. X  
  697. X! char        buf[BUF_SIZE];
  698. X! int        line_no;
  699. X! int        num_object;
  700. X! int        proto;        /* file protocol*10 */
  701. X  
  702. X  read_fail_message(file, err)
  703. X  char    *file;
  704. X***************
  705. X*** 37,44 ****
  706. X--- 38,47 ----
  707. X  
  708. X      if (err == 0)        /* Successful read */
  709. X          return;
  710. X+ #ifdef ENAMETOOLONG
  711. X      else if (err == ENAMETOOLONG)
  712. X          put_msg("File name \"%s\" is too long", file);
  713. X+ #endif
  714. X      else if (err == ENOENT)
  715. X          put_msg("File \"%s\" does not exist", file);
  716. X      else if (err == ENOTDIR)
  717. X***************
  718. X*** 89,102 ****
  719. X  FILE  *fp;
  720. X  F_compound    *obj;
  721. X  {
  722. X!     float        vers;
  723. X!         int             status;
  724. X    
  725. X      num_object = 0;
  726. X-     if (fgets(buf,BUF_SIZE,fp)==0)    /* version if anyone is interested */
  727. X-         return -2;
  728. X      bzero((char*)obj, COMOBJ_SIZE);
  729. X!     status = read_objects(fp, obj);
  730. X      fclose(fp);
  731. X      return(status);
  732. X          }
  733. X--- 92,118 ----
  734. X  FILE  *fp;
  735. X  F_compound    *obj;
  736. X  {
  737. X!     int    status;
  738. X!     float    fproto;
  739. X    
  740. X      num_object = 0;
  741. X      bzero((char*)obj, COMOBJ_SIZE);
  742. X!     if (fgets(buf,BUF_SIZE,fp)==0)    /* version */
  743. X!         return -2;
  744. X!     if (strncmp(buf,"#FIG",4)==0)    /* versions 1.4/later have #FIG in first line */
  745. X!         {
  746. X!         if ((sscanf(index(buf,' ')+1,"%f",&fproto))==0)    /* assume 1.4 */
  747. X!             proto=14;
  748. X!         else
  749. X!             proto = (fproto+.01)*10;    /* protocol version*10 */
  750. X!         status = read_objects(fp, obj);
  751. X!         }
  752. X!     else
  753. X!         {
  754. X!         proto = 13;
  755. X!         status = read_1_3_objects(fp, obj);
  756. X!         }
  757. X! 
  758. X      fclose(fp);
  759. X      return(status);
  760. X          }
  761. X***************
  762. X*** 165,171 ****
  763. X              num_object++;
  764. X              break;
  765. X          case O_TEXT :
  766. X!             if ((t = read_textobject()) == NULL) return(-1);
  767. X              if (lt)
  768. X              lt = (lt->next = t);
  769. X              else 
  770. X--- 181,187 ----
  771. X              num_object++;
  772. X              break;
  773. X          case O_TEXT :
  774. X!             if ((t = read_textobject(fp)) == NULL) return(-1);
  775. X              if (lt)
  776. X              lt = (lt->next = t);
  777. X              else 
  778. X***************
  779. X*** 320,326 ****
  780. X              la = com->arcs = a;
  781. X              break;
  782. X          case O_TEXT :
  783. X!             if ((t = read_textobject()) == NULL) { 
  784. X              free_text(&t);
  785. X              return(NULL);
  786. X              }
  787. X--- 336,342 ----
  788. X              la = com->arcs = a;
  789. X              break;
  790. X          case O_TEXT :
  791. X!             if ((t = read_textobject(fp)) == NULL) { 
  792. X              free_text(&t);
  793. X              return(NULL);
  794. X              }
  795. X***************
  796. X*** 391,400 ****
  797. X      l->for_arrow = l->back_arrow = NULL;
  798. X      l->next = NULL;
  799. X  
  800. X!     n = sscanf(buf, "%*d%d%d%d%d%d%d%d%f%d%d%d%d",
  801. X!         &l->type, &l->style, &l->thickness, &l->color,
  802. X!         &l->depth, &l->pen, &l->area_fill, &l->style_val, &fa, &ba);
  803. X!     if (n != 10) {
  804. X          put_msg(Err_incomp, "line", line_no);
  805. X          free((char*)l);
  806. X          return(NULL);
  807. X--- 407,439 ----
  808. X      l->for_arrow = l->back_arrow = NULL;
  809. X      l->next = NULL;
  810. X  
  811. X!     sscanf(buf,"%*d%d",&l->type);
  812. X!     /* 2.0 or later; has separate radius parm for arc-box corners */
  813. X!     if (l->type == T_ARC_BOX && proto >= 20)
  814. X!         {
  815. X!         n = sscanf(buf, "%*d%d%d%d%d%d%d%d%f%d%d%d",
  816. X!             &l->type, &l->style, &l->thickness, &l->color,
  817. X!             &l->depth, &l->pen, &l->area_fill, &l->style_val, &l->radius,
  818. X!             &fa, &ba);
  819. X!         }
  820. X!     /* old format uses pen for radius of arc-box corners */
  821. X!     else
  822. X!         {
  823. X!         n = sscanf(buf, "%*d%d%d%d%d%d%d%d%f%d%d",
  824. X!             &l->type, &l->style, &l->thickness, &l->color,
  825. X!             &l->depth, &l->pen, &l->area_fill, &l->style_val, &fa, &ba);
  826. X!         if (l->type == T_ARC_BOX)
  827. X!             {
  828. X!             l->radius = l->pen;
  829. X!             l->pen = 0;
  830. X!             }
  831. X!         else
  832. X!             l->radius = 0;
  833. X!         }
  834. X! 
  835. X!     if ((proto==14 && n != 10) || 
  836. X!         (proto==20 && (l->type == T_ARC_BOX && n != 11) || 
  837. X!               (l->type != T_ARC_BOX && n != 10))) {
  838. X          put_msg(Err_incomp, "line", line_no);
  839. X          free((char*)l);
  840. X          return(NULL);
  841. X***************
  842. X*** 425,431 ****
  843. X          put_msg(Err_mem);
  844. X          return(NULL);
  845. X          }
  846. X!     p->next = NULL;  /* as noted by E. Erdem 2/15/90 */
  847. X      if (fscanf(fp, "%d%d", &p->x, &p->y) != 2) {
  848. X          put_msg(Err_incomp, "line", line_no);
  849. X          free_linestorage(l);
  850. X--- 464,470 ----
  851. X          put_msg(Err_mem);
  852. X          return(NULL);
  853. X          }
  854. X!     p->next = NULL;
  855. X      if (fscanf(fp, "%d%d", &p->x, &p->y) != 2) {
  856. X          put_msg(Err_incomp, "line", line_no);
  857. X          free_linestorage(l);
  858. X***************
  859. X*** 576,600 ****
  860. X      }
  861. X  
  862. X  static F_text *
  863. X! read_textobject()
  864. X  {
  865. X      F_text    *t;
  866. X      int    n;
  867. X!     char    s[BUF_SIZE];
  868. X  
  869. X      Text_malloc(t);
  870. X      t->next = NULL;
  871. X!     n = sscanf(buf,"%*d%d%d%d%d%d%d%f%d%d%d%d%d %[^\1]",
  872. X          &t->type, &t->font, &t->size, &t->pen,
  873. X          &t->color, &t->depth, &t->angle,
  874. X          &t->style, &t->height, &t->length, 
  875. X!         &t->base_x, &t->base_y, s);
  876. X!     if (n != 13) {
  877. X          put_msg(Err_incomp, "text", line_no);
  878. X          free((char*)t);
  879. X!         return(NULL);
  880. X          }
  881. X!     if (strlen(s) == 0)    /* as noted by E. Erdem 2/15/90 */
  882. X          (void) strcpy(s," ");
  883. X      t->cstring = (char*)calloc((unsigned)(strlen(s)+1), sizeof(char));
  884. X      if (NULL == t->cstring) {
  885. X--- 615,660 ----
  886. X      }
  887. X  
  888. X  static F_text *
  889. X! read_textobject(fp)
  890. X! FILE    *fp;
  891. X  {
  892. X      F_text    *t;
  893. X      int    n;
  894. X!     int    ignore = 0;
  895. X!     char    s[BUF_SIZE], s_temp[BUF_SIZE], junk[2];
  896. X  
  897. X      Text_malloc(t);
  898. X      t->next = NULL;
  899. X!     /* The text object is terminated by a CONTROL-A, so we read
  900. X!            everything up to the CONTROL-A and then read that character.
  901. X!            If we do not find the CONTROL-A on this line then this must
  902. X!            be a multi-line text object and we will have to read more. */
  903. X!     n = sscanf(buf,"%*d%d%d%d%d%d%d%f%d%d%d%d%d %[^\1]%[\1]",
  904. X          &t->type, &t->font, &t->size, &t->pen,
  905. X          &t->color, &t->depth, &t->angle,
  906. X          &t->style, &t->height, &t->length, 
  907. X!         &t->base_x, &t->base_y, s, junk);
  908. X!     if (n != 13 && n != 14) {
  909. X          put_msg(Err_incomp, "text", line_no);
  910. X          free((char*)t);
  911. X!         /* return(NULL); */
  912. X          }
  913. X!     if (n == 13) {
  914. X!       /* Read in the remainder of the text object. */
  915. X!       do {
  916. X!         fgets(buf, BUF_SIZE, fp);
  917. X!         line_no++;  /* As is done in get_line */
  918. X!         n = sscanf(buf,"%[^\1]%[\1]", s_temp, junk);
  919. X!         /* Safety check */
  920. X!         if (strlen(s)+1 + strlen(s_temp)+1 > BUF_SIZE) {
  921. X!           /* Too many characters.  Ignore the rest. */
  922. X!           ignore = 1;
  923. X!         }
  924. X!         if (!ignore)
  925. X!           strcat(s, s_temp);
  926. X!       } while (n == 1);
  927. X!     }
  928. X!     if (strlen(s) == 0)
  929. X          (void) strcpy(s," ");
  930. X      t->cstring = (char*)calloc((unsigned)(strlen(s)+1), sizeof(char));
  931. X      if (NULL == t->cstring) {
  932. X***************
  933. X*** 614,620 ****
  934. X          return(-1);
  935. X          }
  936. X          line_no++;
  937. X!         if (*buf != '#') return(1);        /* Skip comment lines */
  938. X          }
  939. X      }
  940. X  
  941. X--- 674,681 ----
  942. X          return(-1);
  943. X          }
  944. X          line_no++;
  945. X!         if (*buf != '\n' && *buf != '#')    /* Skip empty and comment lines */
  946. X!         return(1);
  947. X          }
  948. X      }
  949. X  
  950. END_OF_FILE
  951. if test 6773 -ne `wc -c <'read.c.diff'`; then
  952.     echo shar: \"'read.c.diff'\" unpacked with wrong size!
  953. fi
  954. # end of 'read.c.diff'
  955. fi
  956. if test -f 'ruler.c.diff' -a "${1}" != "-c" ; then 
  957.   echo shar: Will not clobber existing file \"'ruler.c.diff'\"
  958. else
  959. echo shar: Extracting \"'ruler.c.diff'\" \(6987 characters\)
  960. sed "s/^X//" >'ruler.c.diff' <<'END_OF_FILE'
  961. X*** ruler.c.old    Tue Apr 24 11:48:38 1990
  962. X--- ruler.c    Mon Apr 16 11:36:36 1990
  963. X***************
  964. X*** 33,41 ****
  965. X  
  966. X  static            lasty = -100;
  967. X  static            lastx = -100;
  968. X- static int         start;
  969. X- static char        *number[] = {"0", "1", "2", "3", "4", "5", 
  970. X-                     "6", "7", "8", "9", "10", "11" };
  971. X  static int        troffx = -7, troffy = -10;
  972. X  static char        tr_marker_image[16] = {
  973. X                  0xFE, 0xFF, /* *************** */
  974. X--- 33,38 ----
  975. X***************
  976. X*** 95,104 ****
  977. X  set_toprulermark(x)
  978. X  int    x;
  979. X  {
  980. X!     XClearArea(tool_d, topruler_pixwin,lastx + troffx,
  981. X             TOPRULER_HEIGHT + troffy,trm_pr.width,
  982. X             trm_pr.height, False);
  983. X!     XCopyArea(tool_d, toparrow_pm, topruler_pixwin, topgc,
  984. X          0, 0, trm_pr.width, trm_pr.height,
  985. X          x + troffx, TOPRULER_HEIGHT + troffy);
  986. X      lastx = x;
  987. X--- 92,101 ----
  988. X  set_toprulermark(x)
  989. X  int    x;
  990. X  {
  991. X!     XClearArea(tool_d, topruler_win,lastx + troffx,
  992. X             TOPRULER_HEIGHT + troffy,trm_pr.width,
  993. X             trm_pr.height, False);
  994. X!     XCopyArea(tool_d, toparrow_pm, topruler_win, topgc,
  995. X          0, 0, trm_pr.width, trm_pr.height,
  996. X          x + troffx, TOPRULER_HEIGHT + troffy);
  997. X      lastx = x;
  998. X***************
  999. X*** 145,151 ****
  1000. X  
  1001. X  redisplay_sideruler()
  1002. X  {
  1003. X!     XClearWindow(tool_d, sideruler_pixwin);
  1004. X  }
  1005. X  
  1006. X  int 
  1007. X--- 142,148 ----
  1008. X  
  1009. X  redisplay_sideruler()
  1010. X  {
  1011. X!     XClearWindow(tool_d, sideruler_win);
  1012. X  }
  1013. X  
  1014. X  int 
  1015. X***************
  1016. X*** 170,176 ****
  1017. X  
  1018. X  redisplay_topruler()
  1019. X  {
  1020. X!     XClearWindow(tool_d, topruler_pixwin);
  1021. X  }
  1022. X  
  1023. X  setup_rulers()
  1024. X--- 167,173 ----
  1025. X  
  1026. X  redisplay_topruler()
  1027. X  {
  1028. X!     XClearWindow(tool_d, topruler_win);
  1029. X  }
  1030. X  
  1031. X  setup_rulers()
  1032. X***************
  1033. X*** 183,201 ****
  1034. X  #define TWOMM    (PIX_PER_CM / 5)    
  1035. X      char            number[3];
  1036. X      Arg            tmp_arg[3];
  1037. X!     long            bg, fg;
  1038. X      static Arg        ruler_args[] =
  1039. X      {
  1040. X          { XtNbackgroundPixmap, (XtArgVal)NULL },
  1041. X      };
  1042. X  
  1043. X!     topruler_pixwin  = trswfd = XtWindow(topruler_sw);
  1044. X!     sideruler_pixwin = srswfd = XtWindow(sideruler_sw);
  1045. X!     XDefineCursor(tool_d, trswfd, (Cursor)bull_cursor.bitmap);
  1046. X!     XDefineCursor(tool_d, srswfd, (Cursor)bull_cursor.bitmap);
  1047. X  
  1048. X      /* top ruler, adjustments for digits are kludges based on 6x13 char */
  1049. X!     p = XCreatePixmap(tool_d, topruler_pixwin,
  1050. X                TOPRULER_WIDTH, TOPRULER_HEIGHT,
  1051. X                DefaultDepthOfScreen(tool_s));
  1052. X  
  1053. X--- 180,198 ----
  1054. X  #define TWOMM    (PIX_PER_CM / 5)    
  1055. X      char            number[3];
  1056. X      Arg            tmp_arg[3];
  1057. X!     unsigned long        bg, fg;
  1058. X      static Arg        ruler_args[] =
  1059. X      {
  1060. X          { XtNbackgroundPixmap, (XtArgVal)NULL },
  1061. X      };
  1062. X  
  1063. X!     topruler_win  = XtWindow(topruler_sw);
  1064. X!     sideruler_win = XtWindow(sideruler_sw);
  1065. X!     XDefineCursor(tool_d, topruler_win, (Cursor)bull_cursor.bitmap);
  1066. X!     XDefineCursor(tool_d, sideruler_win, (Cursor)bull_cursor.bitmap);
  1067. X  
  1068. X      /* top ruler, adjustments for digits are kludges based on 6x13 char */
  1069. X!     p = XCreatePixmap(tool_d, topruler_win,
  1070. X                TOPRULER_WIDTH, TOPRULER_HEIGHT,
  1071. X                DefaultDepthOfScreen(tool_s));
  1072. X  
  1073. X***************
  1074. X*** 267,273 ****
  1075. X      XSetBackground(tool_d, gc, 0);
  1076. X  
  1077. X      /* make pixmaps for top ruler arrow */
  1078. X!     toparrow_pm = XCreatePixmap(tool_d, topruler_pixwin, trm_pr.width,
  1079. X                      trm_pr.height,
  1080. X                      DefaultDepthOfScreen(tool_s));
  1081. X      XPutImage(tool_d, toparrow_pm, gc, &trm_pr, 0, 0, 0, 0,
  1082. X--- 264,270 ----
  1083. X      XSetBackground(tool_d, gc, 0);
  1084. X  
  1085. X      /* make pixmaps for top ruler arrow */
  1086. X!     toparrow_pm = XCreatePixmap(tool_d, topruler_win, trm_pr.width,
  1087. X                      trm_pr.height,
  1088. X                      DefaultDepthOfScreen(tool_s));
  1089. X      XPutImage(tool_d, toparrow_pm, gc, &trm_pr, 0, 0, 0, 0,
  1090. X***************
  1091. X*** 274,280 ****
  1092. X          trm_pr.width, trm_pr.height);
  1093. X      
  1094. X      /* side ruler, adjustments for digits are kludges based on 6x13 char */
  1095. X!     p = XCreatePixmap(tool_d, sideruler_pixwin,
  1096. X                SIDERULER_WIDTH, SIDERULER_HEIGHT,
  1097. X                DefaultDepthOfScreen(tool_s));
  1098. X      XtSetArg(tmp_arg[0], XtNbackground, &bg);
  1099. X--- 271,277 ----
  1100. X          trm_pr.width, trm_pr.height);
  1101. X      
  1102. X      /* side ruler, adjustments for digits are kludges based on 6x13 char */
  1103. X!     p = XCreatePixmap(tool_d, sideruler_win,
  1104. X                SIDERULER_WIDTH, SIDERULER_HEIGHT,
  1105. X                DefaultDepthOfScreen(tool_s));
  1106. X      XtSetArg(tmp_arg[0], XtNbackground, &bg);
  1107. X***************
  1108. X*** 388,394 ****
  1109. X      /* make pixmaps for side ruler arrow */
  1110. X      if( appres.RHS_PANEL )
  1111. X      {
  1112. X!         sidearrow_pm = XCreatePixmap(tool_d, sideruler_pixwin,
  1113. X                           srlm_pr.width, srlm_pr.height,
  1114. X                           DefaultDepthOfScreen(tool_s));
  1115. X          XPutImage(tool_d, sidearrow_pm, gc, &srlm_pr, 0, 0, 0, 0,
  1116. X--- 385,391 ----
  1117. X      /* make pixmaps for side ruler arrow */
  1118. X      if( appres.RHS_PANEL )
  1119. X      {
  1120. X!         sidearrow_pm = XCreatePixmap(tool_d, sideruler_win,
  1121. X                           srlm_pr.width, srlm_pr.height,
  1122. X                           DefaultDepthOfScreen(tool_s));
  1123. X          XPutImage(tool_d, sidearrow_pm, gc, &srlm_pr, 0, 0, 0, 0,
  1124. X***************
  1125. X*** 396,402 ****
  1126. X      }
  1127. X      else
  1128. X      {
  1129. X!         sidearrow_pm = XCreatePixmap(tool_d, sideruler_pixwin,
  1130. X                           srrm_pr.width, srrm_pr.height,
  1131. X                           DefaultDepthOfScreen(tool_s));
  1132. X          XPutImage(tool_d, sidearrow_pm, gc, &srrm_pr, 0, 0, 0, 0,
  1133. X--- 393,399 ----
  1134. X      }
  1135. X      else
  1136. X      {
  1137. X!         sidearrow_pm = XCreatePixmap(tool_d, sideruler_win,
  1138. X                           srrm_pr.width, srrm_pr.height,
  1139. X                           DefaultDepthOfScreen(tool_s));
  1140. X          XPutImage(tool_d, sidearrow_pm, gc, &srrm_pr, 0, 0, 0, 0,
  1141. X***************
  1142. X*** 423,437 ****
  1143. X  set_siderulermark(y)
  1144. X  int    y;
  1145. X  {
  1146. X-     int    sy;
  1147. X- 
  1148. X      if( appres.RHS_PANEL ) {
  1149. X          /* Because the ruler uses a background pixmap, we can win
  1150. X             here by using XClearArea to erase the old thing. */
  1151. X!         XClearArea(tool_d, sideruler_pixwin,
  1152. X                 RULER_WIDTH+srloffx, lasty + srloffy,
  1153. X                 srlm_pr.width, srlm_pr.height, False);
  1154. X!         XCopyArea(tool_d, sidearrow_pm, sideruler_pixwin,
  1155. X                sidegc, 0, 0, srlm_pr.width,
  1156. X                srlm_pr.height, RULER_WIDTH+srloffx, y + srloffy);
  1157. X      }
  1158. X--- 420,432 ----
  1159. X  set_siderulermark(y)
  1160. X  int    y;
  1161. X  {
  1162. X      if( appres.RHS_PANEL ) {
  1163. X          /* Because the ruler uses a background pixmap, we can win
  1164. X             here by using XClearArea to erase the old thing. */
  1165. X!         XClearArea(tool_d, sideruler_win,
  1166. X                 RULER_WIDTH+srloffx, lasty + srloffy,
  1167. X                 srlm_pr.width, srlm_pr.height, False);
  1168. X!         XCopyArea(tool_d, sidearrow_pm, sideruler_win,
  1169. X                sidegc, 0, 0, srlm_pr.width,
  1170. X                srlm_pr.height, RULER_WIDTH+srloffx, y + srloffy);
  1171. X      }
  1172. X***************
  1173. X*** 439,448 ****
  1174. X      {
  1175. X          /* Because the ruler uses a background pixmap, we can win
  1176. X             here by using XClearArea to erase the old thing. */
  1177. X!         XClearArea(tool_d, sideruler_pixwin,
  1178. X                 srroffx, lasty + srroffy,
  1179. X                 srlm_pr.width, srlm_pr.height, False);
  1180. X!         XCopyArea(tool_d, sidearrow_pm, sideruler_pixwin,
  1181. X                sidegc, 0, 0, srrm_pr.width,
  1182. X                srrm_pr.height, srroffx, y + srroffy);
  1183. X      }
  1184. X--- 434,443 ----
  1185. X      {
  1186. X          /* Because the ruler uses a background pixmap, we can win
  1187. X             here by using XClearArea to erase the old thing. */
  1188. X!         XClearArea(tool_d, sideruler_win,
  1189. X                 srroffx, lasty + srroffy,
  1190. X                 srlm_pr.width, srlm_pr.height, False);
  1191. X!         XCopyArea(tool_d, sidearrow_pm, sideruler_win,
  1192. X                sidegc, 0, 0, srrm_pr.width,
  1193. X                srrm_pr.height, srroffx, y + srroffy);
  1194. X      }
  1195. END_OF_FILE
  1196. if test 6987 -ne `wc -c <'ruler.c.diff'`; then
  1197.     echo shar: \"'ruler.c.diff'\" unpacked with wrong size!
  1198. fi
  1199. # end of 'ruler.c.diff'
  1200. fi
  1201. if test -f 'text.c.diff' -a "${1}" != "-c" ; then 
  1202.   echo shar: Will not clobber existing file \"'text.c.diff'\"
  1203. else
  1204. echo shar: Extracting \"'text.c.diff'\" \(5047 characters\)
  1205. sed "s/^X//" >'text.c.diff' <<'END_OF_FILE'
  1206. X*** text.c.old    Tue Apr 24 11:48:41 1990
  1207. X--- text.c    Mon Apr 16 11:26:13 1990
  1208. X***************
  1209. X*** 38,44 ****
  1210. X  extern    int        leng_prefix, leng_suffix;
  1211. X  extern    int        cur_color;
  1212. X  extern    int        cur_textstyle;
  1213. X! extern    int        cur_texttype;
  1214. X  extern    float        cur_angle;
  1215. X  
  1216. X  extern    F_compound    objects;
  1217. X--- 38,44 ----
  1218. X  extern    int        leng_prefix, leng_suffix;
  1219. X  extern    int        cur_color;
  1220. X  extern    int        cur_textstyle;
  1221. X! extern    int        cur_textjust;
  1222. X  extern    float        cur_angle;
  1223. X  
  1224. X  extern    F_compound    objects;
  1225. X***************
  1226. X*** 115,122 ****
  1227. X  init_text_input(x, y)
  1228. X  int    x, y;
  1229. X  {
  1230. X!     int abasex, basx;
  1231. X!     int twidth,pwidth;
  1232. X  
  1233. X      cur_x = x;
  1234. X      cur_y = y;
  1235. X--- 115,121 ----
  1236. X  init_text_input(x, y)
  1237. X  int    x, y;
  1238. X  {
  1239. X!     int basx;
  1240. X  
  1241. X      cur_x = x;
  1242. X      cur_y = y;
  1243. X***************
  1244. X*** 130,136 ****
  1245. X      /* set current font info to indicator button settings */
  1246. X      cur_fontsize = size_button;
  1247. X      cur_font = font_button;
  1248. X!     cur_texttype = type_button;
  1249. X  
  1250. X      /* load the X font and get its id for this font, size */
  1251. X      canvas_font = lookfont(cur_font, cur_fontsize);
  1252. X--- 129,135 ----
  1253. X      /* set current font info to indicator button settings */
  1254. X      cur_fontsize = size_button;
  1255. X      cur_font = font_button;
  1256. X!     cur_textjust = type_button;
  1257. X  
  1258. X      /* load the X font and get its id for this font, size */
  1259. X      canvas_font = lookfont(cur_font, cur_fontsize);
  1260. X***************
  1261. X*** 141,155 ****
  1262. X          leng_prefix = leng_suffix = 0;
  1263. X          *suffix = 0;
  1264. X          prefix[leng_prefix] = '\0';
  1265. X!         abasex = base_x = cur_x;
  1266. X          base_y = cur_y;
  1267. X-         twidth = 0;
  1268. X-         pwidth = 0;
  1269. X          }
  1270. X      else {         /* clicked on existing text */
  1271. X          /* leng_prefix is # of char in the text before the cursor */
  1272. X          leng_suffix = strlen(cur_text->cstring);
  1273. X!         abasex = basx = cur_text->base_x;
  1274. X          if (cur_text->type == T_CENTER_JUSTIFIED)
  1275. X          basx -= cur_text->length/2;
  1276. X          else if (cur_text->type == T_RIGHT_JUSTIFIED)
  1277. X--- 140,152 ----
  1278. X          leng_prefix = leng_suffix = 0;
  1279. X          *suffix = 0;
  1280. X          prefix[leng_prefix] = '\0';
  1281. X!         base_x = cur_x;
  1282. X          base_y = cur_y;
  1283. X          }
  1284. X      else {         /* clicked on existing text */
  1285. X          /* leng_prefix is # of char in the text before the cursor */
  1286. X          leng_suffix = strlen(cur_text->cstring);
  1287. X!         basx = cur_text->base_x;
  1288. X          if (cur_text->type == T_CENTER_JUSTIFIED)
  1289. X          basx -= cur_text->length/2;
  1290. X          else if (cur_text->type == T_RIGHT_JUSTIFIED)
  1291. X***************
  1292. X*** 160,175 ****
  1293. X          strcpy(suffix, &cur_text->cstring[leng_prefix]);
  1294. X          tsize = pf_textwidth(cur_text->font, cur_text->size, leng_prefix, prefix);
  1295. X          ssize = pf_textwidth(cur_text->font, cur_text->size, leng_suffix, suffix);
  1296. X-         pwidth = tsize.x;        /* pixel width of prefix */
  1297. X-         twidth = pwidth+ssize.x;    /* total pixel width of string */
  1298. X          cur_x = base_x = basx;
  1299. X          cur_y = base_y = cur_text->base_y;
  1300. X          cur_x += tsize.x;
  1301. X          cur_font = cur_text->font;
  1302. X          cur_fontsize = cur_text->size;
  1303. X!         cur_texttype = cur_text->type;
  1304. X          }
  1305. X!     initialize_char_handler(canvas_pixwin, finish_text_input, 
  1306. X              base_x, base_y);
  1307. X      }
  1308. X  
  1309. X--- 157,170 ----
  1310. X          strcpy(suffix, &cur_text->cstring[leng_prefix]);
  1311. X          tsize = pf_textwidth(cur_text->font, cur_text->size, leng_prefix, prefix);
  1312. X          ssize = pf_textwidth(cur_text->font, cur_text->size, leng_suffix, suffix);
  1313. X          cur_x = base_x = basx;
  1314. X          cur_y = base_y = cur_text->base_y;
  1315. X          cur_x += tsize.x;
  1316. X          cur_font = cur_text->font;
  1317. X          cur_fontsize = cur_text->size;
  1318. X!         cur_textjust = cur_text->type;
  1319. X          }
  1320. X!     initialize_char_handler(canvas_win, finish_text_input, 
  1321. X              base_x, base_y);
  1322. X      }
  1323. X  
  1324. X***************
  1325. X*** 197,203 ****
  1326. X          return(NULL);
  1327. X          }
  1328. X      text->cstring = calloc((unsigned)(leng_prefix+1), sizeof(char));
  1329. X!     text->type = cur_texttype;;
  1330. X      text->font = cur_font;    /* put in current font number */
  1331. X      text->size = cur_fontsize;    /* added 9/25/89 B.V.Smith */
  1332. X      text->angle = cur_angle;
  1333. X--- 192,198 ----
  1334. X          return(NULL);
  1335. X          }
  1336. X      text->cstring = calloc((unsigned)(leng_prefix+1), sizeof(char));
  1337. X!     text->type = cur_textjust;;
  1338. X      text->font = cur_font;    /* put in current font number */
  1339. X      text->size = cur_fontsize;    /* added 9/25/89 B.V.Smith */
  1340. X      text->angle = cur_angle;
  1341. X***************
  1342. X*** 204,210 ****
  1343. X      text->style = cur_textstyle;
  1344. X      text->color = cur_color;
  1345. X      text->depth = 0;
  1346. X!     text->pen = NULL;
  1347. X      size = pf_textwidth(text->font, text->size, leng_prefix, prefix);
  1348. X      text->length = size.x;    /* in pixels */
  1349. X      text->height = size.y;    /* in pixels */
  1350. X--- 199,205 ----
  1351. X      text->style = cur_textstyle;
  1352. X      text->color = cur_color;
  1353. X      text->depth = 0;
  1354. X!     text->pen = 0;
  1355. X      size = pf_textwidth(text->font, text->size, leng_prefix, prefix);
  1356. X      text->length = size.x;    /* in pixels */
  1357. X      text->height = size.y;    /* in pixels */
  1358. X***************
  1359. X*** 277,282 ****
  1360. X          else
  1361. X              x -= size.x;
  1362. X          }
  1363. X!     pw_text(canvas_pixwin, x, text->base_y, 
  1364. X          op, text->font, text->size, text->cstring);
  1365. X      }
  1366. X--- 272,277 ----
  1367. X          else
  1368. X              x -= size.x;
  1369. X          }
  1370. X!     pw_text(canvas_win, x, text->base_y, 
  1371. X          op, text->font, text->size, text->cstring);
  1372. X      }
  1373. END_OF_FILE
  1374. if test 5047 -ne `wc -c <'text.c.diff'`; then
  1375.     echo shar: \"'text.c.diff'\" unpacked with wrong size!
  1376. fi
  1377. # end of 'text.c.diff'
  1378. fi
  1379. if test -f 'xtra.c.diff' -a "${1}" != "-c" ; then 
  1380.   echo shar: Will not clobber existing file \"'xtra.c.diff'\"
  1381. else
  1382. echo shar: Extracting \"'xtra.c.diff'\" \(7309 characters\)
  1383. sed "s/^X//" >'xtra.c.diff' <<'END_OF_FILE'
  1384. X*** xtra.c.old    Tue Apr 24 11:48:47 1990
  1385. X--- xtra.c    Wed Apr 18 09:43:06 1990
  1386. X***************
  1387. X*** 13,19 ****
  1388. X  #include "font.h"
  1389. X  #include "object.h"
  1390. X  
  1391. X! extern int        gc_thickness[], gc_line_style[];
  1392. X  
  1393. X  extern PIX_FONT        lookfont();
  1394. X  
  1395. X--- 13,19 ----
  1396. X  #include "font.h"
  1397. X  #include "object.h"
  1398. X  
  1399. X! extern int        gc_thickness[0x10], gc_line_style[0x10];
  1400. X  
  1401. X  extern PIX_FONT        lookfont();
  1402. X  
  1403. X***************
  1404. X*** 58,85 ****
  1405. X  {
  1406. X      register GC    ngc;
  1407. X      XGCValues    gcv;
  1408. X!     int        gcmask;
  1409. X  
  1410. X      gcv.font = roman_font->fid;
  1411. X      gcv.join_style = JoinMiter;
  1412. X      gcmask = GCJoinStyle|GCFunction|GCForeground|GCBackground|GCFont;
  1413. X      switch (op) {
  1414. X!     case PAINT:
  1415. X          gcv.foreground = fg;
  1416. X          gcv.background = bg;
  1417. X          gcv.function = GXcopy;
  1418. X          break;
  1419. X!     case ERASE:
  1420. X          gcv.foreground = bg;
  1421. X          gcv.background = bg;
  1422. X          gcv.function = GXcopy;
  1423. X          break;
  1424. X!     case INV_PAINT:
  1425. X          gcv.foreground = fg ^ bg;
  1426. X          gcv.background = bg;
  1427. X          gcv.function = GXxor;
  1428. X          break;
  1429. X!     case MERGE:
  1430. X          gcv.foreground = fg;
  1431. X          gcv.background = bg;
  1432. X          gcv.function = GXor;
  1433. X--- 58,85 ----
  1434. X  {
  1435. X      register GC    ngc;
  1436. X      XGCValues    gcv;
  1437. X!     unsigned long    gcmask;
  1438. X  
  1439. X      gcv.font = roman_font->fid;
  1440. X      gcv.join_style = JoinMiter;
  1441. X      gcmask = GCJoinStyle|GCFunction|GCForeground|GCBackground|GCFont;
  1442. X      switch (op) {
  1443. X!         case PAINT:
  1444. X          gcv.foreground = fg;
  1445. X          gcv.background = bg;
  1446. X          gcv.function = GXcopy;
  1447. X          break;
  1448. X!         case ERASE:
  1449. X          gcv.foreground = bg;
  1450. X          gcv.background = bg;
  1451. X          gcv.function = GXcopy;
  1452. X          break;
  1453. X!         case INV_PAINT:
  1454. X          gcv.foreground = fg ^ bg;
  1455. X          gcv.background = bg;
  1456. X          gcv.function = GXxor;
  1457. X          break;
  1458. X!         case MERGE:
  1459. X          gcv.foreground = fg;
  1460. X          gcv.background = bg;
  1461. X          gcv.function = GXor;
  1462. X***************
  1463. X*** 125,130 ****
  1464. X--- 125,153 ----
  1465. X      sidegc = makegc(INV_PAINT, fg, bg);
  1466. X  }
  1467. X  
  1468. X+ /* create the gc's for area fill (PAINT and ERASE) */
  1469. X+ /* the fill_pm[] and unfill_pm[] must already be created */
  1470. X+ 
  1471. X+ init_fill_gc()
  1472. X+     {
  1473. X+     XGCValues gcv;
  1474. X+     int i;
  1475. X+ 
  1476. X+     gcv.fill_style = FillOpaqueStippled;
  1477. X+     gcv.arc_mode = ArcPieSlice;    /* fill mode for arcs */
  1478. X+     gcv.fill_rule = EvenOddRule/*WindingRule*/;
  1479. X+     for (i=0; i<NUMFILLPATS; i++)
  1480. X+         {
  1481. X+         fill_gc[i] = makegc(PAINT, x_fg_color.pixel, x_bg_color.pixel);
  1482. X+         un_fill_gc[i] = makegc(ERASE, x_fg_color.pixel, x_bg_color.pixel);
  1483. X+         gcv.stipple = fill_pm[i];
  1484. X+         XChangeGC(tool_d, fill_gc[i], 
  1485. X+             GCStipple|GCFillStyle|GCFillRule|GCArcMode, &gcv);
  1486. X+         XChangeGC(tool_d, un_fill_gc[i], 
  1487. X+             GCStipple|GCFillStyle|GCArcMode, &gcv);
  1488. X+         }
  1489. X+     }
  1490. X+ 
  1491. X  /* grey images for fill patterns */
  1492. X  
  1493. X  #ifndef TFX
  1494. X***************
  1495. X*** 161,198 ****
  1496. X     };
  1497. X  #endif
  1498. X  
  1499. X- /* create the gc's for area fill (PAINT and ERASE) */
  1500. X  
  1501. X! init_fill_gc()
  1502. X      {
  1503. X-     XGCValues gcv;
  1504. X      int i;
  1505. X  
  1506. X-     gcv.fill_style = FillOpaqueStippled;
  1507. X-     gcv.arc_mode = ArcPieSlice;    /* fill mode for arcs */
  1508. X-     gcv.fill_rule = EvenOddRule/*WindingRule*/;
  1509. X      for (i=0; i<NUMFILLPATS; i++)
  1510. X!         {
  1511. X!         /* if we want the area fill to be "meshed" on top of existing
  1512. X!            filled objects, then we must use stippling.  This means
  1513. X!            creating a one-plane bitmap and setting the stipple part
  1514. X!            of the gc and selecting stipple fill mode.
  1515. X!         */
  1516. X!         fill_pm[i] = XCreateBitmapFromData(tool_d, XtWindow(canvas_sw),
  1517. X!                 fill_images[i],8,8);
  1518. X!         /* create pixmaps of area-fill colors for indicator */
  1519. X!         ind_fill_pm[i] = XCreatePixmapFromBitmapData(tool_d, XtWindow(canvas_sw),
  1520. X!                 fill_images[i],8,8,
  1521. X!                 x_fg_color.pixel,x_bg_color.pixel,
  1522. X!                 DefaultDepthOfScreen(tool_s));
  1523. X!         fill_gc[i] = makegc(PAINT, x_fg_color.pixel, x_bg_color.pixel);
  1524. X!         un_fill_gc[i] = makegc(ERASE, x_fg_color.pixel, x_bg_color.pixel);
  1525. X!         gcv.stipple = fill_pm[i];
  1526. X!         XChangeGC(tool_d, fill_gc[i], 
  1527. X!             GCStipple|GCFillStyle|GCFillRule|GCArcMode, &gcv);
  1528. X!         XChangeGC(tool_d, un_fill_gc[i], 
  1529. X!             GCStipple|GCFillStyle|GCArcMode, &gcv);
  1530. X!         }
  1531. X      }
  1532. X  
  1533. X  /*
  1534. X--- 184,207 ----
  1535. X     };
  1536. X  #endif
  1537. X  
  1538. X  
  1539. X! /* generate the fill pixmaps */
  1540. X! 
  1541. X! init_fill_pm()
  1542. X      {
  1543. X      int i;
  1544. X  
  1545. X      for (i=0; i<NUMFILLPATS; i++)
  1546. X!         {
  1547. X!         fill_pm[i] = XCreateBitmapFromData(tool_d, XtWindow(canvas_sw),
  1548. X!             fill_images[i],8,8);
  1549. X!         /* create pixmaps of area-fill colors for indicator */
  1550. X!         ind_fill_pm[i] = XCreatePixmapFromBitmapData(tool_d, 
  1551. X!             XtWindow(canvas_sw),
  1552. X!             fill_images[i],8,8,
  1553. X!             x_fg_color.pixel,x_bg_color.pixel,
  1554. X!             DefaultDepthOfScreen(tool_s));
  1555. X!         }
  1556. X      }
  1557. X  
  1558. X  /*
  1559. X***************
  1560. X*** 201,207 ****
  1561. X  **    the users consent, so maybe the original code is wrong?
  1562. X  */
  1563. X  win_setmouseposition(w,x,y)
  1564. X!     FDTYPE        w;
  1565. X      int        x, y;
  1566. X  {
  1567. X  }
  1568. X--- 210,216 ----
  1569. X  **    the users consent, so maybe the original code is wrong?
  1570. X  */
  1571. X  win_setmouseposition(w,x,y)
  1572. X!     Window        w;
  1573. X      int        x, y;
  1574. X  {
  1575. X  }
  1576. X***************
  1577. X*** 266,283 ****
  1578. X      char        buf[1];
  1579. X      XWindowAttributes    attr;
  1580. X  
  1581. X!     XClearArea(tool_d, msgswfd, 0, 0, 0, 0, False);
  1582. X      /* uses knowledge that msg_gccache[PAINT] uses roman_font - tsk */
  1583. X      len = strlen(prompt);
  1584. X      width = char_width(roman_font);
  1585. X      y = char_height(roman_font) + 2;
  1586. X!     XDrawString(tool_d, msgswfd, msg_gccache[PAINT], 2, y, prompt, len);
  1587. X      x = width * len + 4;
  1588. X!     XGetWindowAttributes(tool_d, msgswfd, &attr);
  1589. X!     XSelectInput(tool_d, msgswfd, attr.your_event_mask | KeyPressMask);
  1590. X      for (;;)
  1591. X      {
  1592. X!         XWindowEvent(tool_d, msgswfd, KeyPressMask, &event);
  1593. X          if (event.type != KeyPress)
  1594. X              continue;
  1595. X          if (XLookupString(ke, buf, sizeof(buf), NULL, NULL) <= 0)
  1596. X--- 275,292 ----
  1597. X      char        buf[1];
  1598. X      XWindowAttributes    attr;
  1599. X  
  1600. X!     XClearArea(tool_d, msg_win, 0, 0, 0, 0, False);
  1601. X      /* uses knowledge that msg_gccache[PAINT] uses roman_font - tsk */
  1602. X      len = strlen(prompt);
  1603. X      width = char_width(roman_font);
  1604. X      y = char_height(roman_font) + 2;
  1605. X!     XDrawString(tool_d, msg_win, msg_gccache[PAINT], 2, y, prompt, len);
  1606. X      x = width * len + 4;
  1607. X!     XGetWindowAttributes(tool_d, msg_win, &attr);
  1608. X!     XSelectInput(tool_d, msg_win, attr.your_event_mask | KeyPressMask);
  1609. X      for (;;)
  1610. X      {
  1611. X!         XWindowEvent(tool_d, msg_win, KeyPressMask, &event);
  1612. X          if (event.type != KeyPress)
  1613. X              continue;
  1614. X          if (XLookupString(ke, buf, sizeof(buf), NULL, NULL) <= 0)
  1615. X***************
  1616. X*** 290,296 ****
  1617. X              {
  1618. X                  x -= width;
  1619. X                  --r;
  1620. X!                 XDrawString(tool_d, msgswfd, msg_gccache[ERASE],
  1621. X                      x, y, r, 1);
  1622. X              }
  1623. X              break;
  1624. X--- 299,305 ----
  1625. X              {
  1626. X                  x -= width;
  1627. X                  --r;
  1628. X!                 XDrawString(tool_d, msg_win, msg_gccache[ERASE],
  1629. X                      x, y, r, 1);
  1630. X              }
  1631. X              break;
  1632. X***************
  1633. X*** 300,306 ****
  1634. X              {
  1635. X                  x -= width;
  1636. X                  --r;
  1637. X!                 XDrawString(tool_d, msgswfd, msg_gccache[ERASE],
  1638. X                      x, y, r, 1);
  1639. X              }
  1640. X              break;
  1641. X--- 309,315 ----
  1642. X              {
  1643. X                  x -= width;
  1644. X                  --r;
  1645. X!                 XDrawString(tool_d, msg_win, msg_gccache[ERASE],
  1646. X                      x, y, r, 1);
  1647. X              }
  1648. X              break;
  1649. X***************
  1650. X*** 307,318 ****
  1651. X          case CR:
  1652. X          case NL:
  1653. X              *r = '\0';
  1654. X!             XClearArea(tool_d, msgswfd, 0, 0, 0, 0, False);
  1655. X              return;
  1656. X          default:
  1657. X              if (buf[0] < ' ' || buf[0] > '~')
  1658. X                  continue;
  1659. X!             XDrawString(tool_d, msgswfd, msg_gccache[PAINT],
  1660. X                  x, y, buf, 1);
  1661. X              x += width;
  1662. X              *r++ = buf[0];
  1663. X--- 316,327 ----
  1664. X          case CR:
  1665. X          case NL:
  1666. X              *r = '\0';
  1667. X!             XClearArea(tool_d, msg_win, 0, 0, 0, 0, False);
  1668. X              return;
  1669. X          default:
  1670. X              if (buf[0] < ' ' || buf[0] > '~')
  1671. X                  continue;
  1672. X!             XDrawString(tool_d, msg_win, msg_gccache[PAINT],
  1673. X                  x, y, buf, 1);
  1674. X              x += width;
  1675. X              *r++ = buf[0];
  1676. END_OF_FILE
  1677. if test 7309 -ne `wc -c <'xtra.c.diff'`; then
  1678.     echo shar: \"'xtra.c.diff'\" unpacked with wrong size!
  1679. fi
  1680. # end of 'xtra.c.diff'
  1681. fi
  1682. echo shar: End of archive 3 \(of 6\).
  1683. cp /dev/null ark3isdone
  1684. MISSING=""
  1685. for I in 1 2 3 4 5 6 ; do
  1686.     if test ! -f ark${I}isdone ; then
  1687.     MISSING="${MISSING} ${I}"
  1688.     fi
  1689. done
  1690. if test "${MISSING}" = "" ; then
  1691.     echo You have unpacked all 6 archives.
  1692.     rm -f ark[1-9]isdone
  1693. else
  1694.     echo You still need to unpack the following archives:
  1695.     echo "        " ${MISSING}
  1696. fi
  1697. ##  End of shell archive.
  1698. exit 0
  1699.  
  1700. dan
  1701. -----------------------------------------------------------
  1702.             O'Reilly && Associates
  1703.         argv@sun.com / argv@ora.com
  1704.        632 Petaluma Ave, Sebastopol, CA 95472 
  1705.      800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104
  1706.     Opinions expressed reflect those of the author only.
  1707.